import { createStore } from "vuex";

let store = createStore({
    state() {
        return {
            telphone: "",
            password: "",
            telcode: "",
            token: "",
            userid: ""
        }
    },

    mutations: {
        // 存储电话号码
        changePhone(state, payload) {
            state.telphone = payload
        },

        // 存储密码
        passwordStore(state, payload) {
            state.password = payload
        },

        // 改变验证码
        changeCode(state, payload) {
            state.telcode = payload
        },

        // token存储
        tokenStore(state, payload) {
            state.token = payload
        },

        // userid存储
        useridStore(state, payload) {
            state.userid = payload
        }
    }
})

export default store